// pc/02user/masterInfo.js
var co = require('../../js/common.js')
var _this, get_status
Page({
   data: {
      master: {},
      inviter: {}
   },

   onLoad: function (opt) {
      _this = this
      get_status = opt.get_status
      this.getUserInfo(opt)
   },
   //师傅信息
   getUserInfo: function (opt) {
      var param = {
         unionid: opt.unionid,
         isShowPhone: get_status
      }
      co.getShareApi('user/mg/getuserinfo2', param, function (res) {
         _this.setData({ master: res.data })
         _this.getInviter(res.data)
      })
   },
   //师傅的邀请人
   getInviter: function (data) {
      var param = { unionid: data.inviter_uid }
      co.getShareApi('user/Mg/invitedMe', param, function (res) {
         _this.setData({ inviter: res.data })
      })
   },

   onReady: function () { },

   onShareAppMessage: function () { }
})